<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
      .one{
        color: red;
      }
    </style>
    <!-- 引入vue3 js库 -->
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>
<body>
    <div id="app">
        <p v-for="(value,index) in user">
            {{value.userId}},{{value.userName}},{{value.userSex}}
            {{index}}
        </p>
        <button @click="oper(index)">操作</button>
    </div>
    <script>
        Vue.createApp({
            data(){
                return{
                    user:
                    [
                        {
                            userId:1001,
                            userName:'jack',
                            userSex:'男'
                        }
                    ]
                }
            },
            methods:{
                oper(index){
                    console.log(this.user[index])
                }
            }

        }).mount("#app")
    </script>
</body>
</html>
